﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using GemBlaster.UI;

namespace GemBlaster.Mechanics
{
    public class IntroView : IUiView
    {
        IGameController Controller = null;
        GemBlasterSplash Splash = null;

        public void Init(IGameController controller)
        {
            Controller = controller;
        }

        public void Activate()
        {
            if (Splash == null)
            {
                Splash = new GemBlasterSplash();
                Splash.PlayGame += delegate(object sender, EventArgs ea)
                {
                    Controller.CurrentView = UiViewType.Game;
                };

                Splash.GameInfo += delegate(object sender, EventArgs ea)
                {
                    Controller.CurrentView = UiViewType.HowToPlay;
                };
            }

            Controller.AddVisual(Splash);
        }

        public void Deactivate()
        {
            Controller.RemoveVisual(Splash);
        }
    }
}
